package com.g2.admin.model.po;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.g2.admin.model.to.AuthTreeTo;
import io.swagger.annotations.ApiModelProperty;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 权限信息表，记录所有权限信息：菜单、按钮、操作等
 **/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "auth_authority")
public class AuthAuthorityPo implements Serializable {
	private static final long serialVersionUID = -945187905988958500L;

	@ApiModelProperty(value = "权限编码")
	private String code;
	@ApiModelProperty(value = "创建时间")
	private Date createTime;
	@ApiModelProperty(value = "创建者ID")
	private Long creator;
	@ApiModelProperty(value = "链接地址，只有栏目和菜单才有会有此字段。考虑兼容到url、id触发、调用方法触发")
	private String href;
	@ApiModelProperty(value = "菜单ICON，只有栏目和菜单才有会有此字段。考虑兼容三种情况：1、url；2、class引用；3、icon的base64编码。")
	private String icon;
	@TableId(value = "id", type = IdType.AUTO)
    private Long id;
	@ApiModelProperty(value = "权限名称")
	private String name;
	@ApiModelProperty(value = "所属父权限编码")
	private String parentCode;
	@ApiModelProperty(value = "所属父权限名称")
	private String parentName;
	@ApiModelProperty(value = "备注说明")
	private String remark;
	@ApiModelProperty(value = "排序：数字越大越在前面")
	private Integer sort;
	@ApiModelProperty(value = "所属系统编码")
	private String systemCode;
	@ApiModelProperty(value = "所属系统名称")
	private String systemName;
	@ApiModelProperty(value = "类型：1、栏目；2、菜单；3、按钮；4、功能。第4类型属于后台校验的权限")
	private Integer type;
	@ApiModelProperty(value = "最后一次更新时间")
	private Date updateTime;
	@ApiModelProperty(value = "更新人")
	private Long updater;
	@TableField(exist = false)
	private List<AuthAuthorityPo> children;
}